#!/user/bin/evn python
# -*- coding:utf-8 -*-
#se = set([1,2,3])
#sa = set([3,4,5,5])
#print se & sa
#print se | sa
'''
a = (['x','y','z'])
b = {'val':23,'mean':u'点密度'}

def vari(fun,*args,**kw):
	print u'函数'+fun+u'在坐标',
	for coo in args:		
		print coo,
	print u'处值为 ',
	print kw['val']+u'  意义为'+kw['mean']
		
vari('f(x,y) = kx+by',*a,**b)
'''

'''
#尾递归
def fatch(n,pro=1):
	if n == 1:
		return pro
	return fatch(n-1,n*pro)
		
print fatch(1000)
'''
'''
L = [0,1,2,3,4,5,6,7]
Y = L
L.append(8)
print Y


for i,v in enumerate([1,2,3,4,5]):
	print i,v

'''

#print [x*x for x in range(1,5) if x == 2]

#print [m+n for m in 'XYZ' for n in 'ABC']
#import os
#print [d for d in os.listdir('.')]
'''
from collections import Iterable
L = ['Hello','World',18,'Apple',None]
#print [s.lower() for s in L if isinstance(s,Iterable)]
print [s.lower() if isinstance(s,str) else s for s in L ]
'''
'''
g = (x*x for x in range(10))
print g.next()
print u'多一点'
for x in g :
	print x
'''
'''
#map-reduce
def fn(x,y):
	return x*10+y

def char2num(c):
	return {'0':0,'1':1,'2':2,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9}[c]

print reduce(fn,map(char2num,'13579'))
'''
'''
l = ['adam','LISA','barT']

def hump(str):
	str1 = str[0:1].upper()
	str2 = str[1:].lower()
	return str1 + str2
	return str1+str2

def deal():
	print map(hump,l)

deal()	
'''
'''
l = [1,2,3,4,5]
def prod(l):
'''

'''filter() 过滤[1,...,100]的素数'''
l = range(1,101)
def is_nprimenum(num):
	if num == 1:return True
	lis = range(2,num)
	for n in lis:
		if(num%n == 0):
			return True
	return False
	
print filter(is_nprimenum,l)